package Interfazeak;
/**
 * 
 * @author Txantxangorriak
 *
 */
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Color;
import javax.swing.JButton;

import Futbol_Liga.Liga;

import java.awt.Font;
import java.awt.SystemColor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;

public class EI_FUTBOL_LIGA extends JFrame {

	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					EI_FUTBOL_LIGA frame = new EI_FUTBOL_LIGA();
					frame.setVisible(true);
					frame.setTitle("Futbol Liga");
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public EI_FUTBOL_LIGA() {
		
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBackground(Color.BLUE);
		contentPane.setForeground(Color.WHITE);
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JButton hasieratuBotoia = new JButton("HASIERATU LIGA");
		hasieratuBotoia.setFont(new Font("Tahoma", Font.BOLD, 16));
		hasieratuBotoia.setForeground(SystemColor.desktop);
		hasieratuBotoia.setBackground(SystemColor.inactiveCaption);
		hasieratuBotoia.setBounds(133, 85, 192, 75);
		hasieratuBotoia.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				Liga liga= Liga.getLiga();
				try {
					liga.ligaHasieratu();
				} catch (IOException e) {
					e.printStackTrace();
				}
				System.out.println("Liga hasieratu da");//Konprobatzeko
				EI_MENUA fl= new EI_MENUA();
				 fl.setVisible(true);
				EI_FUTBOL_LIGA.this.setVisible(false);
				 
			}});

		contentPane.add(hasieratuBotoia);
	}
}
